Skip to content

Conversation

@aidendef
Copy link

@aidendef aidendef commented Sep 5, 2025

feat: Add CLOVA Studio model provider

  • Add ClovaModel class implementing Model abstract base
  • Support for HCX-005 model with SSE streaming
  • Bearer token authentication (CLOVA_API_KEY)
  • Bilingual support (Korean and English)
  • Custom SSE parser for CLOVA's response format
  • Comprehensive unit and integration tests
  • Add clova optional dependency to pyproject.toml

Description

This PR adds support for CLOVA Studio, Naver's Korean language AI platform, to the Strands Agents SDK. CLOVA Studio provides state-of-the-art Korean language models that are optimized for Korean context and nuances.

Key Features

  • Native Korean Support: Optimized for Korean language understanding and generation
  • Bilingual Capability: Seamlessly handles both Korean and English
  • SSE Streaming: Full streaming support with custom parser for CLOVA's response format
  • Simple Authentication: Only requires CLOVA_API_KEY (Bearer token)
  • Comprehensive Testing: 10 unit tests and 8 integration tests

Implementation Details

The ClovaModel class extends the abstract Model base class and implements:

  • stream() method for real-time response streaming
  • get_config() and update_config() for dynamic configuration
  • Custom SSE parser to handle CLOVA's single-chunk response format
  • Support for system prompts and various parameters (temperature, max_tokens, top_p, etc.)

Usage Example

from strands.models.clova import ClovaModel
from strands import Agent

# Initialize CLOVA model
model = ClovaModel(
    api_key="your-clova-api-key",
    model="HCX-005",
    temperature=0.7,
    max_tokens=2048
)

# Create agent with CLOVA
agent = Agent(model=model)

# Use for Korean language tasks
response = await agent.invoke_async("한국의 전통 음식을 소개해주세요")

Related Issues

Closes #802

Documentation PR

Type of Change

New feature

Testing

How have you tested the change?

Test Coverage

  • Unit Tests: 10 tests covering all major functionality

    • Model initialization and configuration
    • Streaming response handling
    • Error handling (API failures, missing keys)
    • System prompt support
    • Configuration updates
  • Integration Tests: 8 tests with real API

    • Basic streaming functionality
    • Korean and English language support
    • Temperature and token limit parameters
    • Bilingual capabilities
    • Model configuration management

Test Results

# Unit tests
$ hatch test tests/strands/models/test_clova.py
======================== 10 passed, 1 warning in 2.60s =========================

# Integration tests (with API key)
$ hatch run test-integ tests_integ/models/test_model_clova.py
============================== 8 passed in 15.23s ==============================

Verification

  • I ran hatch run prepare
  • All tests pass successfully
  • Code is formatted with hatch fmt
  • No new warnings generated

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Add ClovaModel class implementing Model abstract base
- Support for HCX-005 model with SSE streaming
- Bearer token authentication (CLOVA_API_KEY)
- Bilingual support (Korean and English)
- Custom SSE parser for CLOVA's response format
- Comprehensive unit and integration tests
- Add clova optional dependency to pyproject.toml
@yonib05
Copy link
Member

yonib05 commented Sep 5, 2025

Hey @aidendef,
Thank you so much for this PR and your contribution! We really appreciate the work you've put into this, and CLOVA studio looks like a fantastic platform.
While we'd love to include every great model provider, we've reached a point where we need to be selective about adding new providers directly to the core SDK to keep it maintainable and focused.

That said, we absolutely want to support your integration! We'd recommend one of these approaches:

  • Option 1: Publish your model provider implementation as a standalone package on PyPI. This way, customers can easily install it and use it with our SDK. Here's a great example of how this works: https://pypi.org/project/strands-nvidia-nim/
  • Option 2: Include it as a submodule in the CLOVA Studio SDK Python (unclear if one exists), which would give users direct access through an existing package.

Either way, we'd be happy to feature you on our documentation page as a supported model provider, giving you visibility to our community.
Would either of these approaches work for your use case? We're excited to see CLOVA Studio integrated with our ecosystem!

@aidendef
Copy link
Author

aidendef commented Sep 10, 2025

Hi @yonib05

Thank you for the thoughtful response and for considering this contribution! I completely understand the need to keep the core SDK maintainable and focused.

I'm happy to proceed with Option 1 - publishing as a standalone PyPI package. This approach makes sense and would provide the flexibility for users who need Korean language support.

The CLOVA Studio model provider is now available as a standalone PyPI package:

@yonib05
Copy link
Member

yonib05 commented Sep 30, 2025

Hey @aidendef,

This is awesome Thank you for your valuable contribution. We will get the new model provider added to the docs and site on our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Clova Model provider

2 participants